package top.infopub.enums.sg;

import org.apache.commons.lang3.StringUtils;

public enum CoopInfoTypesEnums {
    COMPLEX("1", "联合体单位"),
    COMMITMENT("2", "承贷企业"),
    TOTALPKG("3", "总包单位"),
    SUBPKG("4", "分包单位"),
    DEVICE("5", "设备单位"),
    OWNER("6", "业主单位"),
    OTHER("9", "其他单位")
    ;

    private String types;

    private String name;

    CoopInfoTypesEnums(String types, String name) {
        this.types = types;
        this.name = name;
    }

    public static CoopInfoTypesEnums getByTypes(String types) {
        if (StringUtils.isBlank(types)) return null;
        for (CoopInfoTypesEnums cit : CoopInfoTypesEnums.values()) {
            if (StringUtils.equals(types, cit.getTypes())) {
                return cit;
            }
        }
        return null;
    }

    public String getTypes() {
        return types;
    }

    public void setTypes(String types) {
        this.types = types;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
